#include "lrn_vector.h"
#include <iostream>
#include <vector>

using namespace std;

int main() {
  initVector();
  initMultiVector();
  iterateVector();
}

void initVector() {
  vector<int> v;
  v.push_back(1);
  v.push_back(2);
  v.push_back(3);
  v.push_back(4);
  v.push_back(5);
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
};

void initMultiVector() {
  vector<vector<int>> m(2, vector<int>(3));
  m[0][0] = 1;
  m[0][1] = 2;
  m[0][2] = 3;
  m[1][0] = 4;
  m[1][1] = 5;
  m[1][2] = 6;
  for (int i = 0; i < m.size(); i++) {
    for (int j = 0; j < m[i].size(); j++) {
      cout << m[i][j] << " ";
    }
    cout << endl;
  }
};

void iterateVector() {
  vector<int> v = {1, 2, 3, 4, 5};
  vector<int>::iterator it1 = v.begin();
  vector<int>::iterator it2 = v.end();
  for (; it1 != it2; it1++) {
    cout << *it1 << " ";
  }
  cout << endl;
}